package com.lqd.mall.system;

import com.lqd.mall.basis.response.CommonResult;
import com.lqd.mall.basis.response.Result;
import com.lqd.mall.interaction.system.SysDeptEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author 零起点
 * @create 2022-03-26 17:54
 */
@Api(tags = "部门信息模块")
@RequestMapping("dept")
public interface SysDeptControllerApi {


    @GetMapping("list")
    @ApiOperation("获取全部部门信息")
    Result<List<SysDeptEntity>> list(SysDeptEntity entity);

    @GetMapping("treeselect")
    @ApiOperation("获取部门下拉树列表")
    Result<List<SysDeptEntity>> treeselect(SysDeptEntity entity);

    @PostMapping
    @ApiOperation("添加部门信息")
    CommonResult save(@RequestBody SysDeptEntity entity);

    @PutMapping
    CommonResult upateSysDeptEntity(@RequestBody SysDeptEntity entity);

    @GetMapping("{deptId}")
    @ApiOperation("根据id查询部门信息")
    Result<SysDeptEntity> findSysDeptEntitById(@PathVariable("deptId") Long deptId);

    @DeleteMapping("{deptId}")
    @ApiOperation("删除部门信息")
    CommonResult deleteSysDeptEntitById(@PathVariable("deptId") Long deptId);

    @GetMapping("/list/exclude/{deptId}")
    Result<List<SysDeptEntity>>  excludeChild(@PathVariable(value = "deptId", required = true) Long deptId);

}
